package com.zxm.result;

import java.io.Serializable;
import java.util.List;

import org.omg.PortableServer.THREAD_POLICY_ID;

/**
 * 存放分页的信息 自定义分页
 * @author 张鑫铭
 *
 */
public class GuhealthPageInfo implements Serializable{
	
	private static final long serialVersionUID = 6295343100521945461L;
	//当前页
	private Integer currentPage;
	//每页数量 
	private Integer pageSize; 
	//总记录数
	private Long count;
	//总页数
	private Integer totalPage;
	//是否有上一页
	private boolean havePre;
	//是否有下一页
	private boolean haveNext;
	//上一页
	private Integer prePage;
	//下一页
	private Integer nextPage;
	//首页
	private Integer firstPage;
	//尾页
	private Integer finalPage;
	//列表
	private List<?> rows;
	
	
	public GuhealthPageInfo() {
		super();
	}
	
	public GuhealthPageInfo(Integer currentPage,Integer pageSize,Long count) {
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		this.count = count;
		this.totalPage = (int)Math.ceil(count.doubleValue()/pageSize.doubleValue());
		this.havePre = !(currentPage==1);
		this.haveNext = !(currentPage.equals(totalPage));
		if(havePre) {
			this.prePage = currentPage-1;
		}
		if(haveNext) {
			this.nextPage = currentPage+1;
		}
		this.firstPage = 1;
		this.finalPage = totalPage;
	}
	public Integer getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Long getCount() {
		return count;
	}
	public void setCount(Long count) {
		this.count = count;
	}
	
	public Integer getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}

	
	public boolean isHavePre() {
		return havePre;
	}

	public void setHavePre(boolean havePre) {
		this.havePre = havePre;
	}

	public boolean isHaveNext() {
		return haveNext;
	}

	public void setHaveNext(boolean haveNext) {
		this.haveNext = haveNext;
	}

	public Integer getPrePage() {
		return prePage;
	}
	public void setPrePage(Integer prePage) {
		this.prePage = prePage;
	}
	public Integer getNextPage() {
		return nextPage;
	}
	public void setNextPage(Integer nextPage) {
		this.nextPage = nextPage;
	}
	public Integer getFirstPage() {
		return firstPage;
	}
	public void setFirstPage(Integer firstPage) {
		this.firstPage = firstPage;
	}
	public Integer getFinalPage() {
		return finalPage;
	}
	public void setFinalPage(Integer finalPage) {
		this.finalPage = finalPage;
	}
	public List<?> getRows() {
		return rows;
	}
	public void setRows(List<?> rows) {
		this.rows = rows;
	}
	
}
